package chances.wechat.api;

public class TokenResovlerProxy implements TokenResovler {

	private TokenResovler localTokenResovler;
	private TokenResovler remoteTokenResovler;
	private boolean remote;
	
	@Override
	public String getToken(String appId, String secret) {
		if(remote) {
			return remoteTokenResovler.getToken(appId, secret);
		} else {
			return localTokenResovler.getToken(appId, secret);
		}
	}

	@Override
	public String getJSToken(String accessToken) {
		if(remote) {
			return remoteTokenResovler.getJSToken(accessToken);
		} else {
			return localTokenResovler.getJSToken(accessToken);
		}
	}

}
